package cn.mafangui.hotel.enums;

/**
 * @author kalpa
 * @date 2022/3/17 15:37
 * @description
 */
public enum ExceptionEnum {
    // 1 开头与用户有关

    USER_NOT_FOUND(101, "未找到用户信息"),

    // 2 开头的与订单有关

    ORDER_ADD_FAIED(201, "订单创建失败"),
    ORDER_UPDATE_FAIED(202, "订单修改失败"),

    // 3开头与房间有关
    NOT_FOUND_AVAILABLE_ROOM(301, "该房型已没有空闲房间"),
    NOT_FOUND_ROOM(301, "未找到房间"),

    // 4开头与房间类型有关
    NOT_FOUND_ROOM_TYPE(401, "未找到房间类型"),

    // 5 开头与车位有关
    STALL_NOT_FOUND(501, "车位创建失败"),
    STALL_ADD_FAIED(502, "车位创建失败"),
    STALL_UPDATE_FAIED(503, "车位修改失败"),
    STALL_DELETE_FAIED(504, "车位信息删除失败"),

    // 6 开头与车库订单有关
    GARAGE_RECORD_NOT_FOUND(601, "未找到用户信息"),
    GARAGE_RECORD_ADD_FAIED(602, "创建停车纪录失败"),
    GARAGE_RECORD_UPDATE_FAIED(603, "修改停车纪录失败"),
    GARAGE_RECORD_DELETE_FAIED(604, "停车纪录删除失败"),

    // 7开头与入住纪录有关
    NOT_FOUND_CHECK_IN(701, "未找到入住纪录"),

    // 8 开头与工作账号有关
    WORKER_NOT_FOUND(801, "未找到操作员/管理员信息"),



    SYSTEM_ERROR(999, "无效");
    /**
     * 错误代码
     */
    private Integer code;
    /**
     * 错误信息
     */
    private String msg;

    ExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
